﻿<div id="grid" style="margin-left:1%;"></div>

<script type="text/javascript">
    var _window = {};

    _window.options = {
        /* grid */
        columns: [
            { name: 'Id', hide: true }
            , {
                display: '可以使用的审批流程',
                width: '100%',
                render: function (r) {
                    return '<a href="/Item/CreateItem?id=' + r.Id + '" target="_self">' + r.Name + '</a>';
                }
            }
        ],
        toolbar: { items: [] }
    };

    _window.control = {
        grid: null
    };

    _window.grid = function () {
        _window.control.grid = $('#grid').ligerGrid({
            columns: _window.options.columns,
            //toolbar: { items: _window.options.toolbar },
            usePager: false,
            resizable: false,
            frozen: false,
            height: '98%',
            width: '98%',
            dataAction: 'local'
        });

        @{
            string data = "var data = { Total: " + ViewBag.Total +
                ", Rows: " + Html.Raw(ViewBag.Rows) + "};";
        }
        @Html.Raw(data)

        //var data = { Rows: [{Id: '123', Name: '测试'}]};

        _window.control.grid.loadData(data);
    }

    _window.init = function () {
        _window.grid();
    }

    /* ---------------------------------------------------------------------   */


    /* ---------------------------------------------------------------------   */
    $(document).ready(function () {
        _window.init();
    });
</script>